﻿using System.ComponentModel.DataAnnotations;

namespace MVVMtutorialAdvanced.Web
{
	public class AuthorDTO
	{
		[Key]
		[Display(Order = 3)]
		public int Id { get; set; }

		[Required(AllowEmptyStrings = false, ErrorMessage = "Muss- Feld")]
		[StringLength(20, ErrorMessage = "Maximal 20 Buchstaben")]
		[RegularExpression("[A-Za-z0-9 ]*", ErrorMessage = "Nur A-z und Zahlen")]
		[Display(
			Name = "Vorname", 
			Description = "Dies ist der Vorname", 
			Prompt = "Prompt Vorname",
			Order = 2, 
			AutoGenerateField = false)]
		public string FirstName { get; set; }

		[Required(AllowEmptyStrings = false, ErrorMessage = "Muss- Feld")]
		[StringLength(20, ErrorMessage = "Maximal 20 Buchstaben")]
		[RegularExpression("[A-Za-z0-9 ]*", ErrorMessage = "Nur A-z und Zahlen")]
		[Display(
			Name = "Nachname",
			Description = "Dies ist der Nachname",
			Prompt = "Prompt Nachname",
			Order = 1)]
		public string LastName { get; set; }
	}
}